package threadDemo;

public class Test2 {
    public static void main(String[] args) {
        MyThread t = new MyThread();
        Thread thread = new Thread(t);
        Thread thread1 = new Thread(t);
        // 开启线程
        thread.start();;
        thread1.start();
    }
}

class MyThread implements Runnable {

    @Override
    public void run() {
        for (int i=0 ; i<100;i++){
            System.out.println(Thread.currentThread().getName()+" "+i);
        }
    }
}
